﻿@using Webdiyer.WebControls.Mvc
@model  MvcWeb.ViewModels.Inventory.InventoryDetailModel
@{
    ViewBag.Title = "资产盘点详情";
}
@if (false)
{
    <script src="../../Scripts/jquery-1.5.1-vsdoc.js" type="text/javascript"></script>
}
<div style="padding: 5px 10px;">
    <input type="button" onclick="history.go(-1)" value="返回资产盘点列表" class="btn_green" />
</div>
<div style="padding: 0px 10px; margin-bottom: 5px;">
    
</div>
<div style="padding: 0px 10px;">
    <table class="tb" width="98%" style="text-align: center;">
        <tr>
            <th>资产标签</th><th>资产条形码</th><th>资产名称</th><th >原资产值</th><th valign="top">现资产值</th>
            <th>应存放地点</th><th>实存放地点</th><th>处理建议</th> <th>处理结果</th><th>是否盘点</th><th>备注</th> <th>操作</th>
        </tr>
        @foreach (var m in Model.inventoryDetailModelList)
        {
            <tr>
                <td>@m.AssetLabel</td>
                <td>@m.AssetBarcode</td>
                <td>@m.AssetName</td>
                <td>@m.AssetPurchaseCost</td>
                <td>@m.AssetWorth</td>
                <td> @m.AssetCustodyAddress</td>                
                <td>@m.InventoryCustodyAddress</td>
                <td>@m.InventoryHandleAdvice</td>
                <td>@m.InventoryHandleResult</td>
                <td>@(m.InventoryExists== true ?"是":"否")</td>
                <td>@m.InventoryRemark</td>
                <td width="80"> 

                    @{
                        if (  m.AssetInventoryDetailID != 0 )
                        {
                             <a href="@Url.Action("editInventDetail", "Inventory", new { id = m.AssetInventoryDetailID })">编辑</a>
                        }    
                    }
                </td>
            </tr>
        }
        <tr>
            <td colspan="12" style="text-align: left;">
                <div style="float: left;">
                   <input type="button" value="盘点审核通过" class="btn_green" onclick="checkInvent(@Model.InventoryID);" />
                </div>
                <div style="float: right;">
                    @Html.Pager(Model.inventoryDetailModelList)
                </div>
            </td>
        </tr>
    </table>
</div>


<script type="text/javascript">
    $(function () {
        $("#conditionModel_InventoryStartTime").ligerDateEditor({ initValue: $("#conditionModel_InventoryStartTime").val() });
        $("#conditionModel_InventoryEndTime").ligerDateEditor({ initValue: $("#conditionModel_InventoryEndTime").val() });
    });

    function checkInvent(id) {
        if (!confirm('确定盘点通过？')) return;
        $.get('/Inventory/checkInvent/' +id+ '?t=' + Math.random(), function (data) {
            alert("设置成功");
        });

    }
</script>